package org.lw.bootstrap.controller;

import javax.servlet.http.HttpServletRequest;

import org.lw.bootstrap.dto.Result;
import org.lw.bootstrap.logic.AppLogic;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 *
 *
 */
@Controller
@RequestMapping("/app/demo")
public class AppController extends AbstractController{

	private AppLogic appLogic = getLogic(AppLogic.class);

	/**
	 *
	 * @param request
	 * @return
	 */
	@RequestMapping("tail_file")
	@ResponseBody
	public Result tailFile(HttpServletRequest request, String path) {
		return appLogic.tailFile(request, path);
	};

	/**
	 *
	 * @param request
	 * @return
	 */
	@RequestMapping("close_tail_file")
	@ResponseBody
	public Result closeTailFile(HttpServletRequest request, String path) {
		return appLogic.closeTailFile(request, path);
	};

	/**
	 *
	 * @param request
	 * @return
	 */
	@RequestMapping("get_fake_info")
	@ResponseBody
	public Result getFakeInfo(HttpServletRequest request, String path) {
		return appLogic.getFakeInfo(request, path);
	};
}
